﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace FIM
{
    public class BiAxialKeys : BiAxialInput
    {
        public override Vector2 Value
        {
            get
            {
                Vector2 result = new Vector2();
                result.X = right.Value - left.Value;
                result.Y = up.Value - down.Value;
                return result;
            }
        }
        Key up, down, left, right;

        public BiAxialKeys(CManager inputManager, Keys upKey, Keys downKey, Keys leftKey, Keys rightKey)
            : this(inputManager, 1,upKey,downKey,leftKey,rightKey) { }

        public BiAxialKeys(CManager inputManager, float multiplier, Keys upKey, Keys downKey, Keys leftKey, Keys rightKey)
            : base(inputManager, multiplier)
        {
            up = new Key(inputManager, multiplier, upKey);
            down = new Key(inputManager, multiplier, downKey);
            left = new Key(inputManager, multiplier, leftKey);
            right = new Key(inputManager, multiplier, rightKey);
        }
    }
}
